﻿Imports System.ComponentModel
Public Class Photo
    Implements INotifyPropertyChanged

    Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) _
      Implements INotifyPropertyChanged.PropertyChanged

    Private _id As Int64
    Private _caption As String '
    Private _width, _height As Integer
    Private _size As Integer
    Private _imageURL As String '
    Private _previewURL As String '
  
#Region " Public Properties "

    Public Property ID() As Int64
        Get
            Return _id
        End Get
        Set(ByVal value As Int64)
            If _id <> value Then
                _id = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("ID"))
            End If
        End Set
    End Property

    Public Property Caption() As String
        Get
            Return _caption
        End Get
        Set(ByVal value As String)
            If _caption <> value Then
                _caption = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Caption"))
            End If
        End Set
    End Property

    Public Property Width() As Integer
        Get
            Return _width
        End Get
        Set(ByVal value As Integer)
            If _width <> value Then
                _width = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Width"))
            End If
        End Set
    End Property

    Public Property Height() As Integer
        Get
            Return _height
        End Get
        Set(ByVal value As Integer)
            If _height <> value Then
                _height = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Height"))
            End If
        End Set
    End Property

    Public Property Size() As Integer
        Get
            Return _size
        End Get
        Set(ByVal value As Integer)
            If _size <> value Then
                _size = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("Size"))
            End If
        End Set
    End Property

    Public Property ImageURL() As String
        Get
            Return _imageURL
        End Get
        Set(ByVal value As String)
            If Not value = _imageURL Then
                If _imageURL <> value Then
                    _imageURL = value
                    RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("ImageURL"))
                End If
            End If
        End Set
    End Property

    Public Property PreviewURL() As String
        Get
            Return _previewURL
        End Get
        Set(ByVal value As String)
            If _previewURL <> value Then
                _previewURL = value
                RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("PreviewURL"))
            End If
        End Set
    End Property

#End Region

End Class
